<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of news
 *
 * @author Administrator
 */
class news extends CI_Controller{
    //put your code here
    function __construct() {
        parent::__construct();
    }
    
    function index(){
        include_once 'loading_alway.php';
        $data['site']='site/news';
        $data['latest_news']=$this->news_model->getLatestNews();
        $data['all_news']=$this->news_model->getAllNews(10);
        $this->load->view('template',$data);
    }
    
    function details(){
        include_once 'loading_alway.php';
        $id=$this->uri->segment(3);
        
        $data['site']='site/news';
        $data['latest_news']=$this->news_model->getNewsByID($id);
        $data['all_news']=$this->news_model->getAllNews(10);
        $this->load->view('template',$data);
    }
}

?>
